﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SD.DataAccess;
using SD.Commons.DataFilters;

namespace SD.Business
{
    public sealed class SupportingMaterialBus
    {
        //[TrungL1]:Add comment for variable Dao and all method in class Supporting Material at 9:00AM 25-Dec-2012
        //Declare instance of SupportingMaterialDao class
        private static readonly SupportingMaterialDao Dao = new SupportingMaterialDao();
        /// <summary>
        /// Contructor
        /// </summary>
        private SupportingMaterialBus()
        {

        }
        /// <summary>
        /// Get Supporting Material by Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static SupportingMaterial GetSupportingMaterialById(int id)
        {
            return Dao.GetSupportingMaterialById(id);
        }
        /// <summary>
        /// Method Get Supporting Material
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="sortType"></param>
        /// <param name="startRowIndex"></param>
        /// <param name="maxRow"></param>
        /// <returns></returns>
        public static IQueryable<SupportingMaterial> GetSupportingMaterial(SupportingMaterialFilter filter, string sortType, int startRowIndex, int maxRow)
        {
            return Dao.GetList(filter, sortType, startRowIndex, maxRow);
        }
        /// <summary>
        /// Method Get Supporting Material Count
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static int GetSupportingMaterialCount(SupportingMaterialFilter filter)
        {
            return Dao.GetListCount(filter);
        }
        /// <summary>
        /// Method Insert Supporting Material
        /// </summary>
        /// <param name="supportingMaterial"></param>
        /// <returns></returns>
        public static bool InsertSupportingMaterial(SupportingMaterial supportingMaterial)
        {
            return Dao.InsertSupportingMaterial(supportingMaterial);
        }
        /// <summary>
        /// Method Update Supporting Material
        /// </summary>
        /// <param name="supportingMaterial"></param>
        /// <returns></returns>
        public static bool UpdateSupportingMaterial(SupportingMaterial supportingMaterial)
        {
            return Dao.EditSupportingMaterial(supportingMaterial);
        }
        /// <summary>
        /// Method Update Status Supporting Material
        /// </summary>
        /// <param name="supportingMaterialId"></param>
        /// <param name="status"></param>
        public static void UpdateStatusSupportingMaterial(int supportingMaterialId, bool status)
        {
            Dao.UpdateStatusSupportingMaterial(supportingMaterialId, status);
        }
    }
}
